<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pygccxml</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th bgcolor="#70b0f0" class="navbar-select"
          >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://www.language-binding.net">pygccxml</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Package&nbsp;pygccxml
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="pygccxml-module.html">Package pygccxml</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt>  <tt class="py-line"><tt class="py-comment"># Copyright 2004-2008 Roman Yakovenko.</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Distributed under the Boost Software License, Version 1.0. (See</tt> </tt>
<a name="L3"></a><tt class="py-lineno"> 3</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># accompanying file LICENSE_1_0.txt or copy at</tt> </tt>
<a name="L4"></a><tt class="py-lineno"> 4</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># http://www.boost.org/LICENSE_1_0.txt)</tt> </tt>
<a name="L5"></a><tt class="py-lineno"> 5</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L6"></a><tt class="py-lineno"> 6</tt>  <tt class="py-line"><tt class="py-docstring">"""Python GCC-XML front end.</tt> </tt>
<a name="L7"></a><tt class="py-lineno"> 7</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L8"></a><tt class="py-lineno"> 8</tt>  <tt class="py-line"><tt class="py-docstring">This package provides functionality to extract and inspect</tt> </tt>
<a name="L9"></a><tt class="py-lineno"> 9</tt>  <tt class="py-line"><tt class="py-docstring">declarations from C/C++ header files. This is accomplished</tt> </tt>
<a name="L10"></a><tt class="py-lineno">10</tt>  <tt class="py-line"><tt class="py-docstring">by invoking the external tool U{gccxml&lt;http://www.gccxml.org/&gt;}</tt> </tt>
<a name="L11"></a><tt class="py-lineno">11</tt>  <tt class="py-line"><tt class="py-docstring">which parses a header file and dumps the declarations as a</tt> </tt>
<a name="L12"></a><tt class="py-lineno">12</tt>  <tt class="py-line"><tt class="py-docstring">XML file. This XML file is then read by pygccxml and the contents</tt> </tt>
<a name="L13"></a><tt class="py-lineno">13</tt>  <tt class="py-line"><tt class="py-docstring">are made available as appropriate Python objects.</tt> </tt>
<a name="L14"></a><tt class="py-lineno">14</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L15"></a><tt class="py-lineno">15</tt>  <tt class="py-line"><tt class="py-docstring">To parse a set of C/C++ header files you use the</tt> </tt>
<a name="L16"></a><tt class="py-lineno">16</tt>  <tt class="py-line"><tt class="py-docstring">L{parse()&lt;parser.parse&gt;} function in the L{parser} sub package which</tt> </tt>
<a name="L17"></a><tt class="py-lineno">17</tt>  <tt class="py-line"><tt class="py-docstring">returns a tree that contains all declarations found in the header</tt> </tt>
<a name="L18"></a><tt class="py-lineno">18</tt>  <tt class="py-line"><tt class="py-docstring">files. The root of the tree represents the main namespace C{::} and</tt> </tt>
<a name="L19"></a><tt class="py-lineno">19</tt>  <tt class="py-line"><tt class="py-docstring">the children nodes represent the namespace contents such as other</tt> </tt>
<a name="L20"></a><tt class="py-lineno">20</tt>  <tt class="py-line"><tt class="py-docstring">namespaces, classes, functions, etc. Each node in the tree is an</tt> </tt>
<a name="L21"></a><tt class="py-lineno">21</tt>  <tt class="py-line"><tt class="py-docstring">object of a type derived from the</tt> </tt>
<a name="L22"></a><tt class="py-lineno">22</tt>  <tt class="py-line"><tt class="py-docstring">L{declaration_t&lt;declarations.declaration_t&gt;} base class. An inner</tt> </tt>
<a name="L23"></a><tt class="py-lineno">23</tt>  <tt class="py-line"><tt class="py-docstring">node is always either a namespace (L{namespace_t&lt;declarations.namespace_t&gt;})</tt> </tt>
<a name="L24"></a><tt class="py-lineno">24</tt>  <tt class="py-line"><tt class="py-docstring">or a class (L{class_t&lt;declarations.class_t&gt;}) which are both derived</tt> </tt>
<a name="L25"></a><tt class="py-lineno">25</tt>  <tt class="py-line"><tt class="py-docstring">from L{scopedef_t&lt;declarations.scopedef_t&gt;}. Everything else (free functions,</tt> </tt>
<a name="L26"></a><tt class="py-lineno">26</tt>  <tt class="py-line"><tt class="py-docstring">member functions, enumerations, variables, etc.) is always a leaf.</tt> </tt>
<a name="L27"></a><tt class="py-lineno">27</tt>  <tt class="py-line"><tt class="py-docstring">You will find all those declaration classes in the L{declarations}</tt> </tt>
<a name="L28"></a><tt class="py-lineno">28</tt>  <tt class="py-line"><tt class="py-docstring">sub-package.</tt> </tt>
<a name="L29"></a><tt class="py-lineno">29</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L30"></a><tt class="py-lineno">30</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L31"></a><tt class="py-lineno">31</tt>  <tt class="py-line"> </tt>
<a name="L32"></a><tt class="py-lineno">32</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-0" class="py-name" targets="Package pygccxml=pygccxml-module.html"><a title="pygccxml" class="py-name" href="#" onclick="return doclink('link-0', 'pygccxml', 'link-0');">pygccxml</a></tt><tt class="py-op">.</tt><tt id="link-1" class="py-name" targets="Package pygccxml.declarations=pygccxml.declarations-module.html,Variable pygccxml.declarations.namespace.namespace_t.declarations=pygccxml.declarations.namespace.namespace_t-class.html#declarations,Variable pygccxml.declarations.scopedef.scopedef_t.declarations=pygccxml.declarations.scopedef.scopedef_t-class.html#declarations,Variable pygccxml.parser.declarations_cache.record_t.declarations=pygccxml.parser.declarations_cache.record_t-class.html#declarations,Method pygccxml.parser.scanner.scanner_t.declarations()=pygccxml.parser.scanner.scanner_t-class.html#declarations"><a title="pygccxml.declarations
pygccxml.declarations.namespace.namespace_t.declarations
pygccxml.declarations.scopedef.scopedef_t.declarations
pygccxml.parser.declarations_cache.record_t.declarations
pygccxml.parser.scanner.scanner_t.declarations" class="py-name" href="#" onclick="return doclink('link-1', 'declarations', 'link-1');">declarations</a></tt> <tt class="py-keyword">as</tt> <tt id="link-2" class="py-name"><a title="pygccxml.declarations
pygccxml.declarations.namespace.namespace_t.declarations
pygccxml.declarations.scopedef.scopedef_t.declarations
pygccxml.parser.declarations_cache.record_t.declarations
pygccxml.parser.scanner.scanner_t.declarations" class="py-name" href="#" onclick="return doclink('link-2', 'declarations', 'link-1');">declarations</a></tt> </tt>
<a name="L33"></a><tt class="py-lineno">33</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-3" class="py-name"><a title="pygccxml" class="py-name" href="#" onclick="return doclink('link-3', 'pygccxml', 'link-0');">pygccxml</a></tt><tt class="py-op">.</tt><tt id="link-4" class="py-name" targets="Package pygccxml.parser=pygccxml.parser-module.html"><a title="pygccxml.parser" class="py-name" href="#" onclick="return doclink('link-4', 'parser', 'link-4');">parser</a></tt> <tt class="py-keyword">as</tt> <tt id="link-5" class="py-name"><a title="pygccxml.parser" class="py-name" href="#" onclick="return doclink('link-5', 'parser', 'link-4');">parser</a></tt> </tt>
<a name="L34"></a><tt class="py-lineno">34</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-6" class="py-name"><a title="pygccxml" class="py-name" href="#" onclick="return doclink('link-6', 'pygccxml', 'link-0');">pygccxml</a></tt><tt class="py-op">.</tt><tt id="link-7" class="py-name" targets="Package pygccxml.utils=pygccxml.utils-module.html"><a title="pygccxml.utils" class="py-name" href="#" onclick="return doclink('link-7', 'utils', 'link-7');">utils</a></tt> <tt class="py-keyword">as</tt> <tt id="link-8" class="py-name"><a title="pygccxml.utils" class="py-name" href="#" onclick="return doclink('link-8', 'utils', 'link-7');">utils</a></tt> </tt>
<a name="L35"></a><tt class="py-lineno">35</tt>  <tt class="py-line"> </tt>
<a name="L36"></a><tt class="py-lineno">36</tt>  <tt class="py-line"><tt class="py-comment">#TODO:</tt> </tt>
<a name="L37"></a><tt class="py-lineno">37</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#  1. Write documentation for filtering functionality.</tt> </tt>
<a name="L38"></a><tt class="py-lineno">38</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#  2. Add "explicit" property for constructors</tt> </tt>
<a name="L39"></a><tt class="py-lineno">39</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L40"></a><tt class="py-lineno">40</tt>  <tt class="py-line"><tt class="py-name">__version__</tt> <tt class="py-op">=</tt> <tt class="py-string">'1.0.0'</tt> </tt>
<a name="L41"></a><tt class="py-lineno">41</tt>  <tt class="py-line"> </tt>
<a name="L42"></a><tt class="py-lineno">42</tt>  <tt class="py-line"><tt id="link-9" class="py-name" targets="Variable pygccxml.__revision__=pygccxml-module.html#__revision__"><a title="pygccxml.__revision__" class="py-name" href="#" onclick="return doclink('link-9', '__revision__', 'link-9');">__revision__</a></tt> <tt class="py-op">=</tt> <tt class="py-number">1080</tt> </tt>
<a name="L43"></a><tt class="py-lineno">43</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th bgcolor="#70b0f0" class="navbar-select"
          >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://www.language-binding.net">pygccxml</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1
    on Mon Oct 20 09:00:32 2008
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
